<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<!DOCTYPE html>
<html>
<head>
	<meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;" />
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>${questionnaire.title }</title>

	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/page/weixin/questionnaire.css" />
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/default.css" />

    <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/page/weixin/jweixin-1.0.0.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/common/common.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/page/weixin/questionnaire/questionnaire.js"></script>
</head>
<body>
<div style="padding-left: 5%">
<div> 
    <font size="4">
    	${questionnaire.description }
    </font>
</div>
<hr/>
<form id="frmqa" method="post" enctype="multipart/form-data">
<input type="hidden" id="openId" name="openId" value="${openId }">
<input type="hidden" id="questionnaireId" name="questionnaireId" value="${questionnaire.id }">
<input type="hidden" id="batchNo" name="batchNo" value="${batchNo }">
<div id="divOptions">
<c:forEach var="question" items="${ questions}" varStatus="status">
<div style="margin-top: 10px;">
    <div style="">
    <b>${ status.index + 1}  ${question.description }    </b>
    </div>
	<div>
		<c:forEach var="option" items="${ question.questionOptions}" varStatus="status">
			<div>
			<c:if test="${question.type==1 }">
				<input id="option${option.id }" name="question_${question.id }_1" type="radio" value="${option.id }">
			</c:if>
			<c:if test="${question.type==2 }">
				<input id="option${option.id }" name="question_${question.id }_2" type="checkbox" value="${option.id }">
			</c:if>
			<c:out value="${option.description }"/>
			</div>
		</c:forEach>
		<c:if test="${question.type==3 }">
			<textarea name="question_${question.id }_3" style="height: 50px;width: 80%;"></textarea>
		</c:if>
		</div>
</div>
</c:forEach>
</div>
</form>

<c:if test="${back ==true }">
<div id="divBtns" style="margin-top: 50px;padding-left: 30px;">
	<a id="btnGoBack" href="javascript:void(0)" onclick="goback()" class="easyui-linkbutton" >返回</a>  
</div>
</c:if>
<c:if test="${back != true }">
<div align="center">
	<a class="ui-btn ui-shadow ui-btn-corner-all" href="javascript:void(0)" onclick="submitFrm()" >
		<span class="ui-btn-inner">
			<span class="ui-btn-text">提交</span>
		</span>
	</a>
</div>
</c:if>

</div>
<script type="text/javascript">
wx.config({
    debug: false, 
    appId: '${appId}', 
    timestamp: '${timestamp}', 
    nonceStr: '${nonceStr}', 
    signature: '${signature}',
    jsApiList: ['closeWindow'] 
});

wx.error(function(res){


});

</script>
</body>
</html>